package com.chenxi.service.impl;

import com.chenxi.mapper.SysAuthorityMapper;
import com.chenxi.model.SysAuthority;
import com.chenxi.service.ISysAuthorityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ${DESCRIPTION}
 *
 * @author Hu Xiaolong
 * @version V0.1
 * @create 2017/12/12
 */
@Service("sysAuthorityService")
public class SysAuthorityServiceImpl implements ISysAuthorityService{

    @Autowired
    private SysAuthorityMapper sysAuthorityMapper;
    @Override
    @Cacheable(value = "oauthCache")
    public List<SysAuthority> loadUserAuthorities(Long userId) {
        return sysAuthorityMapper.getAuthoritiesByUserId(userId);
    }
}
